package cn.tannn.cat.file.server.entity;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Index;
import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.Comment;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

/**
 * 存储的桶，不在代码里使用，用于前端的显示
 *
 * @author <a href="https://tannn.cn/">tan</a>
 * @date 2024/3/7 11:05
 */
@Entity
@Table(name = "storage_bucket", indexes = {
        @Index(name = "idx_config_bucket_name", columnList = "name,configId"),
})
@Comment("存储的桶，不在代码里使用，用于前端的显示")
@Getter
@Setter
@ToString
@DynamicUpdate
@DynamicInsert
public class StorageBucket extends CommonBean<StorageBucket> {

    /**
     * 桶名
     */
    @Comment("桶名")
    @Column(columnDefinition = "varchar(100) not null")
    @Schema(description = "桶名")
    private String name;


    /**
     * 存储器字典值[Dict.value]
     */
    @Comment("存储器Id")
    @Column(columnDefinition = "varchar(100) not null")
    @Schema(description = "存储器Id")
    private String configId;


    /**
     * 存储器字典值[Dict.label]
     */
    @Comment("存储器名")
    @Column(columnDefinition = "varchar(100) not null")
    @Schema(description = "存储器名")
    private String configName;


    /**
     * 备注
     */
    @Comment("备注")
    @Column(columnDefinition = "varchar(100)")
    @Schema(description = "备注")
    private String remark;


}
